package com.cdtu.outtake.dto;

import com.cdtu.outtake.domain.Category;
import com.cdtu.outtake.domain.Product;
import com.cdtu.outtake.util.BeanUtils;
import com.cdtu.outtake.domain.Shop;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @Author : shl
 * @Date 2024/3/20 19:08
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ShopDto {
    private Long id;
    private String picture;
    private String name;
    private Double score;
    private Integer sales;
    private Boolean offlinePickUp;
    private Boolean takeaway;
    private Boolean dineIn;
    //    minimum order amount(起送价)
    private Double moa;
    private List<Category> categories;
    private List<Product> products;
    private Integer distance;
    private String notice;

    public static ShopDto toShopDto(Shop shop) {
        ShopDto shopDto = new ShopDto();
        BeanUtils.copyPropertiesIgnoreNull(shop, shopDto);
        return shopDto;
    }
}
